<?php
namespace app\common\validate;

use think\Validate;

class ShopValidate extends Validate
{
    protected $rule =   [
        'id'                         => 'require|number',
        'shop_id'                    => 'require|number',
        'page|页数'                  => 'require|number',
        'limit|条数'                 => 'require|number',
        'back_msg|驳回理由'          => 'require',
        'name|门店名称'              => 'require|length:2,30',
        'cate_id|分类'               => 'require',
        'brief|门店简介'             => 'require|length:2,100',
        'brief_apply|申请简介'       => 'require|length:2,100',
        'bond_min|最小保证金'        => 'require',
        'bond_max|最大保证金'        => 'require',
        'shareholder_money|股份份额' => 'require',
        'shareholder_num|股东人数'   => 'require',
        'address|店铺地址'           => 'require|length:2,200',
        'start_time|开业时间'        => 'require|date',
        'door_img|门头照'            => 'require',
        'type|店铺类型'              => 'require|number',
        'business_time|营业时间'     => 'require',
    ];
    
    protected $scene = [
        /** api */
        'show'   => ['shop_id'],
        'add'    => ['cate_id', 'name', 'brief', 'brief_apply', 'bond_min', 'bond_max', 'shareholder_money', 'shareholder_num', 'start_time', 'address', 'door_img', 'type', 'business_time'],

        /** admin */
        'list'       => ['page', 'limit'],
        'admin_show' => ['id'],
        'back'       => ['id', 'back_msg'],
        'edit'       => ['id', 'cate_id', 'name', 'brief', 'brief_apply', 'bond_max', 'shareholder_money', 'shareholder_num', 'street'],
    ];
}